<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/static/plugins/bootstrap-3.4.1/css/bootstrap.css">
    <link rel="stylesheet" href="/static/plugins/font-awesome-4.7.0/css/font-awesome.css">
    <style>
        th {
        text-align: center;
        }




    </style>
</head>
<body>
<h1 align="center" style="color:red;">首页！</h1>
<!--    下面两行代码，二选一的关系，没登陆显示 跳转  登陆过显示  你好  -->
<!--      通过name是否有值，判断是否登录 你好  -->
{% if name %}
<!--    如果name有值，说明登陆过，判断为true  -->
<p>
    <a href="/loginout/"> 你好，{{name}} </a>
</p>
{% else %}
<!--    如果name无值，没有说明没登陆，判断false    -->
<a href="http://127.0.0.1:8000/login">跳转到登录页面</a>
{% endif %}
<div>
    <form action="/index/" method="get">
        <!--            <i class="fa fa-search" aria-hidden="true"></i>-->
        <input type="text" placeholder="请输入搜索内容" name="keywords">
        <input type="submit" value="搜索">
    </form>
</div>
我的购物车
<div>
    <a href="/shoppingcar/">
        <span class="fa fa-shopping-cart fa-3x" aria-hidden="true" style="color: red"></span>
    </a>
</div>
<table class="table table-bordered table-hover">
    <thead>
    <tr>
        <th>商品序列</th>
        <th>商品名称</th>
        <th>商品图片</th>
        <th>商品价格</th>
        <th>商品数量</th>
    </tr>
    </thead>
    <tbody>
    {% for good in goods%}
    <tr>
        <th>{{good.gid}}</th>
        <th>
            <!--                        {{good.name}}-->
            <a href="/goodinfo/?gid={{good.gid}}">{{good.name}}</a>
        </th>
        <th>
            <img src={{good.imgsrc}} width="50" height="50">
        </th>
        <th>{{good.price}}</th>
        <th>{{good.count}}</th>
    </tr>
    {% endfor %}
    </tbody>
    <tfoot>
    <tr>
        <th colspan="5">
            {% for item in pagelist %}
            <a href="/index/?page={{item}}">{{item}}</a>
            {% endfor %}
        </th>
    </tr>
    </tfoot>
</table>
</body>
</html>
